﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_ScheduleCheckExist]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_ScheduleCheckExist];
GO
CREATE PROCEDURE [dbo].[sproc_ScheduleCheckExist]
    @Date datetime,
             @PeriodID int,
             @Username nvarchar(20),
    @IsExist  bit OUTPUT    
AS  
  if exists (select * from UDS_Schedule where [date]=@Date and periodID=@PeriodID and Username=@Username)
  set @IsExist=1
  else
  set @IsExist=0